package moodish.client.gui.utils;

import java.util.ArrayList;
import java.util.Comparator;

import moodish.client.user.User;

public class SortFriends implements Comparator<User> {

	@Override
	public int compare(User o1, User o2) {
		return o1.getMood().compareTo(o2.getMood());
	}
	
	public static ArrayList<User> usersWithMood(String mood, ArrayList<User> users){
		ArrayList<User> list = new ArrayList<User>();
		for(int i = 0; i <users.size() ; i++){
			if(users.get(i).getMood().equals(mood)){
				list.add(users.get(i));
			}
		}
		return list;
	}
}
